<template>
	<view class="mainpadding2">
		<view class="radius mainpadding tybjs margin_top" v-for="item in list.data" :key="item.id" @click="jumpDetail(item.video_id,item.user_id)">
			<view class="ershiba xiaobai fonweight">订单编号：{{item.order_no}}</view>
			<view class="flextop margin_top">
				<image class="tupian" :src="item.video_image_text" mode=""></image>
				<view class="" style="width: 78%;">
					<view class="ershiba xiaohui">{{item.video_name}}</view>
					<view class="flexbetween margin_top">
						<view class="flexleft">
							<image class="jinbi margin_right2" src="../static/image/sysem/jbd.png" mode=""></image>
							<view class="sanshier" style="color:#FEC84F ;">{{item.pay_price}}</view>
						</view>
						<view class="strongtext xiaohui">{{item.createtime_text}}</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				page: 1,
				limit: 12,
				list: {
					data: []
				},
			}
		},
		onLoad() {
			this.init()
		},
		methods: {
			jumpDetail(id, listuser_id) {
				uni.navigateTo({
					url: "/pages_homepage/shipinxq?id=" + id + "&listuser_id=" + listuser_id
				})
				this.addviewnum(id)
			},
			addviewnum(id) {
				httpRequest.request('/api/videocl/addViewNum', 'GET', {
					id
				}).then(res => {})
			},
			init(isPage, page) {
				let _this = this
				httpRequest.request("/api/videocl/videoOrderIndex", 'GET', {
					page: page || 1,
					limit: 12,
					is_rec: 1,
				}).then(res => {
					if (res.code == 1) {
						let resList = res.data;
						let dataList = _this.list;
						if (isPage == true) {
							_this.list.data = dataList.data.concat(resList.data);
						} else {
							this.list = res.data
							_this.list.data = resList.data;
						}
					}
				}).catch(err => {
					httpRequest.toast(err.msg);
				})
			},
			onReachBottom() {
				let _this = this;
				let list = _this.list;
				let page = _this.page;
				if (list.last_page <= page) {
					return false;
				}
				page++;
				_this.page = page;
				_this.init(true, page);
			},
		}
	}
</script>

<style lang="scss" scoped>
	.jinbi{
		width: 37rpx;
		height: 37rpx;
	}
.tupian{
	width: 124rpx;
	height: 124rpx;
	border-radius: 14rpx 14rpx 14rpx 14rpx;
}
</style>
